<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE >
<html>
<head>
    <title>随e享</title>
    <!-- meta tags start -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="Keywords" content="blinds, premium, mobile, template, HTML, Css"/>
    <meta name="Description" content="Premium mobile HTML/CSS template."/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link href="${ctx}/css/stylemobile.css" rel="stylesheet" type="text/css" media="all"/>
    <script src="${ctx}/js/jquery-1.11.0.min.js" type="text/javascript"></script>
    <link href="${ctx}/css/css.css" rel="stylesheet" type="text/css" media="all" />
    <script type="text/javascript">
        function goBackSecond() {
            window.location.href='${ctx}/appoint/myAppoint';
        }

        function cancelAppoint(id) {
            $.ajax({
                url: "${ctx}/appoint/cancel",
                type: "GET",
                dataType : "json",
                data: {id: id},
                success: function(data) {
                    if(data.code == 200) {
                        alert('解除预约成功');
                        window.location.href='${ctx}/appoint/myAppoint';
                    }
                },
                error: function(text) {}
            });
        }
    </script>
</head>
<body>
<div id="js_article" class="rich_media">
    <div class="rich_media_content" id="js_content">
        <div class="websiteWrapper">
            <div class="headerOuterWrapper">
                <div class="headerWrapper">
                    <span style="color: #fff;">预约项目</span>
                </div>
            </div>
            <div  class="tab-pane" id="Section2">
                <input type="hidden" id="openId" name="openid">
                <div class="list textA">
                    <ul>
                        <li style="border-bottom: hidden">
                            <span>项目名称：</span>
                            <span>${appoint.projectName}</span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span>申请人：</span>
                            <span>${appoint.applyerName}</span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span>手机号</span>
                            <span>${appoint.mobilePhone}</span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span>身份证后六位</span>
                            <span>${appoint.idNumber}</span>
                        </li>

                        <li style="border-bottom: hidden">
                            <span>预约时间：</span>
                            <span>
                                <fmt:formatDate value="${appoint.appointTime}" type="both" />
                            </span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span>申请时间</span>
                            <span><fmt:formatDate value="${appoint.applyTime}" type="date" /></span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span>所属支行：</span>
                            <span>${appoint.subbranch}</span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span>申请状态：</span>
                            <span>
                                <c:if test="${appoint.applyStatus == 0}">
                                    <span>未受理</span>
                                </c:if>
                                <c:if test="${appoint.applyStatus == 1}">
                                    <span>已受理</span>
                                </c:if>
                            </span>
                        </li>
                        <li style="border-bottom: hidden">
                            <span style="margin-top: 20px;">备注信息：</span>
                            <span>${appoint.remark}</span>
                        </li>
                    </ul>
                </div>
                <c:if test="${appoint.applyStatus == 0}">
                    <div class="btn">
                        <input type="button" class="reg" value="解除预约" onclick="cancelAppoint(${appoint.id})">
                    </div>
                </c:if>

            </div>
            <div class="btn">
                <input type="button" id="goBack" class="reg" value="返回" onclick="goBackSecond()">
            </div>

        </div>
    </div>
</div>
</body>
</html>
